﻿<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" validateRequest="false" CodeFile="LoreEdit.aspx.cs" Inherits="main_admin_LoreEdit" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.QuickStart" Assembly="Telerik.QuickStart" %>
<%@ Register TagPrefix="radU" Namespace="Telerik.WebControls" Assembly="RadUpload.Net2" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>资料管理</title>
    <link href="../../css/style.css" rel="stylesheet" type="text/css" />
    <link href="../../css/base.css" rel="stylesheet" type="text/css" />

    <script src="../../js/base.js" type="text/javascript" charset="utf-8"></script>

    <script src="../../js/singleeditpoint.js" type="text/javascript" charset="utf-8"></script>

    <script src="../../js/validator.js" type="text/javascript" charset="utf-8"></script>

    <script src="../../js/comm.js" type="text/javascript" charset="utf-8"></script>
    
    <script src="../../js/common.js" type="text/javascript" charset="utf-8"></script>
       <script type="text/javascript" src="../../Web_ckeditor_html/ckeditor.js"></script>
    <script type="text/javascript" src="../../Web_ckfinder_html/ckfinder.js"></script>

    <script type="text/javascript">	
        
            function tomodifySave(){
                //清除空格	
                TrimAllitems();       
                ClearErrMsg();        
			    var thisForm=document.forms[0];
			    //文件是否上传
			    var up = document.getElementById("upFile");
			    if (up.style.display == "block") {
			        showErrMsg(document.getElementById("upFile"), "请上传文件!");
			        return false;
			    }
			    
                var obj = document.getElementById("ddlLoreType1");
                    if(obj!=null){
			        var ddlLoreType1 = document.getElementById("<%=ddlLoreType1.ClientID%>").value;
			        var ddlLoreType2 = document.getElementById("<%=ddlLoreType2.ClientID%>").value;
			        var ddlLoreType3 = document.getElementById("<%=ddlLoreType3.ClientID%>").value;
			        var ddlLoreType = ddlLoreType1 + ddlLoreType2 + ddlLoreType3;
			        //alert(ddlLoreType);
			        if (ddlLoreType == "") {

			            alert("请选择类型！");
			            return false;
			        }
			    }
			    
			    
				if( Validator.Validate(thisForm,3)) {　
				    
				    var val = CKEDITOR.instances.txt_Lore_CONTENT.getData();
				    if (val.length > 30000) {

				        alert("资料介绍长度不能大于30000");
				        return false;
				    }
				    
				    if (val.length == 0) {
				        alert("资料介绍不能为空");
				        return false;
				    }
				
					return true;
				}
				return false;
			}

			function delfile() {
			    if (confirm("请确认删除文件!")) {
			        var txt_name = document.getElementById("txt_NAME");
			        txt_NAME.value = "";
			        return true;
			    }
			    return false;
			}

			function btnUpfile() {
			    TrimAllitems();
			    ClearErrMsg();
			    //文件是否上传
			    var save = document.getElementById("FileUpload1");
			    //alert(save.value);
			    if (save.value == "") {
			        showErrMsg(document.getElementById("upFile"), "请选择文件!");
			        return false;
			    }
			    return true;
			}
            
            //选择用户发通知－网上申请
			function openChooseUsers(flg) {
			    var url = "../admin/ChooseUser.aspx?EM=WEB.USER_MANAGE&MSG_TYPE=1&SOURCE_ID=<%=SOURCE_ID%>";
			    var send=true;
			    if(flg=='1'){
			        send=confirm("保存成功!\r\n是否发送通知！");	
			    }
			    
			    if(send){    			     
			          openwindow(url + "&" + Math.random(), '用户选择', '900', '600', 'yes');	
    			}
    			 
			    return false;
			}		
		//禁止选择第一级
		function selectReadOnly() {			
			var type_id=<%=type_id%>;
            if(type_id!=''){
                var obj = document.getElementById("ddlLoreType1");
                if(obj!=null){
                    obj.disabled = "disabled";           
                    
                    var id_select= document.getElementById("id_select");   
                    id_select.disabled = "disabled";	
                 }
             }
        }

    </script> 
    
</head>
<body onload="selectReadOnly();">
<form name="form1" method="post" id="form1" runat="server">
<div class="conter_right">
<div class="sfkr"><span>当前位置：</span>资料管理</div>
     <fieldset class="dsadq"><legend style="color:#434449"><span id="page_title" runat="server">资料新增</span></legend>
     <table width="100%" border="0" cellpadding="0" cellspacing="0" class="msels">
       <tr>    
         <td align="right" valign="middle">
                         <font color="red">*&nbsp;</font><asp:Label ID="Label1" runat="server" Text="文件上传："></asp:Label>
                    </td>
                    <td align="left" valign="middle" colspan="3">
                    
                     <div  id="showFile" style="display:none" runat="server">
                        <span id="file_name" runat="server"></span>
                         <asp:ImageButton ID="ImageButton1"  OnClientClick="return delfile();" OnClick="btnDelFile_Click" runat="server" ImageUrl="~/images/del.jpg"   style="cursor:hand" alt="删除"/>

                     </div> 
                     
                     <div id="upFile" style="display:block" runat="server">
                        <radu:radprogressmanager id="Radprogressmanager1"  Width="100%" runat="server" Height="10px" />
                        <radu:radprogressarea id="progressArea1" Width="100%"  runat="server"></radu:radprogressarea>                        
                        <asp:FileUpload ID="FileUpload1" runat="server" />
                        <asp:Button ID="btnSave" CssClass="seaal" runat="server" Text="上传" OnClientClick="return btnUpfile();" OnClick="btnSave_Click" />      
                     </div>                 
                    </td>   
     </tr>  
              <tr>     
      <td width="16%" align="right" valign="middle"><asp:Label ID="lbl_Lore_TITLE" runat="server" Text="标题"></asp:Label>：</td>
        <td width="84%" align="left" valign="middle" colspan="3">
           <asp:TextBox MaxLength="80"  Width="300" CssClass="srjks" ID="txt_Lore_TITLE" runat="server"  dataType="Require" msg="标题不能为空！" ></asp:TextBox>
                                        <asp:Label ID="err_Lore_TITLE" runat="server"></asp:Label></td>
     
     </tr>
     <tr>     
      <tr id="tr_AREA_ID" runat="server">
                   <td align="right" valign="middle">
                         <asp:Label ID="lbl_AREA_ID__AREA_NAME" runat="server" Text="所属区域："></asp:Label>
                    </td>
                    <td align="left" valign="middle" colspan="3">
                      <asp:DropDownList ID="ddl_AREA_ID__AREA_NAME" runat="server" CanZhao="AREA_NAME"
                            TiaoJian="DEL_FLG|0|3" dataType="Require" msg="不能为空" CssClass="saae">
                        </asp:DropDownList>
                        <asp:Label ID="err_AREA_ID__AREA_NAME" runat="server"></asp:Label>
                    </td>                    
      </tr>
     </tr>
     <tr id="tr_loreType" runat="server">
              
        <td width="16%" align="right" valign="middle"><font color="red">*&nbsp;</font><asp:Label ID="lbl_Lore_TYPE" runat="server" Text="资料类型"></asp:Label>：</td>
        <td width="84%" align="left" valign="middle" colspan="3">
        
         <asp:ScriptManager ID="smJs" runat="server">
                    <Services>
                        <asp:ServiceReference Path="../../SearCodintion.asmx" />
                    </Services>
                </asp:ScriptManager>
              <span id="id_select">
                <asp:DropDownList ID="ddlLoreType1" runat="server">
                    </asp:DropDownList></span>
                    &nbsp;
                    <ajaxtoolkit:cascadingdropdown id="cddLoreType1" runat="server" servicepath="../../SearCodintion.asmx"
                        servicemethod="GetLoreType1" category="LoreType1" targetcontrolid="ddlLoreType1"
                        prompttext=" " loadingtext=" ">
                    </ajaxtoolkit:cascadingdropdown>
                    <asp:DropDownList ID="ddlLoreType2" runat="server">
                    </asp:DropDownList>
                    <ajaxtoolkit:cascadingdropdown id="cddLoreType2" runat="server" targetcontrolid="ddlLoreType2"
                        servicepath="../../SearCodintion.asmx" servicemethod="GetLoreType2" category="LoreType2"
                        prompttext=" " loadingtext=" " parentcontrolid="ddlLoreType1">
                     </ajaxtoolkit:cascadingdropdown>
                    <asp:DropDownList ID="ddlLoreType3" runat="server">
                    </asp:DropDownList>
                    <ajaxtoolkit:cascadingdropdown id="cddLoreType3" runat="server" targetcontrolid="ddlLoreType3"
                        servicepath="../../SearCodintion.asmx" servicemethod="GetLoreType3" category="LoreType3"
                        prompttext=" " loadingtext=" " parentcontrolid="ddlLoreType2"></ajaxtoolkit:cascadingdropdown>
                      <asp:DropDownList ID="ddlLoreType4" runat="server">
                                    </asp:DropDownList>
                                    <ajaxtoolkit:cascadingdropdown id="cddLoreType4" runat="server" targetcontrolid="ddlLoreType4"
                                        servicepath="../../SearCodintion.asmx" servicemethod="GetLoreType4" category="LoreType4"
                                        prompttext=" " loadingtext=" " parentcontrolid="ddlLoreType3"></ajaxtoolkit:cascadingdropdown>
         
                        <asp:Label ID="err_Lore_TYPE" runat="server"></asp:Label>
        </td>
      
        
    </tr>

     <tr>     
      <td width="16%" align="right" valign="middle"><asp:Label ID="lbl_Lore_CONTENT" runat="server" Text="介绍"></asp:Label>：</td>
        <td width="34%" align="left" valign="middle" colspan="3">
            <asp:textBox  id="txt_Lore_CONTENT" runat="server" cols="60" rows="6" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" 
                TextMode="MultiLine" Width="488px"></asp:textBox>
                <script type="text/javascript">
                    CKEDITOR.replace('txt_Lore_CONTENT');                   
</script>
                <asp:Label ID="err_Lore_CONTENT" runat="server"></asp:Label></td>
     
     </tr>
     </table>
     </fieldset>
     </div>
      <div style="height:15px"></div>
        <div class="nstkaah" align="center" style="width:90%">
         <asp:Button runat="server" Text="发送通知" CssClass="seaal" ID="btnChooseUsers" ToolTip="通知" 
                                         OnClientClick="return  openChooseUsers();" Visible="false" />
                                         
        <asp:Button runat="server" Text="保存" CssClass="seaal" ID="queding" ToolTip="保存" 
                                         OnClientClick="return  tomodifySave();"   OnClick="queding_Click" />
                                         <asp:Button runat="server" Text="返回" CssClass="seaal" ID="Button3" ToolTip="返回" OnClick="cmdCancel_Click" />
              </div>
              
	<!--jjjjjjjjjjjjjjjjjjjj页脚部分jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj-->
	<div id="footer"></div>
   </form>
</body>
</html>

<script type="text/javascript">
    //selectReadOnly();
    setTimeout(selectReadOnly, 1000);
</script>